package cn.net.isir.dao;

import com.github.pagehelper.PageInfo;
import cn.net.isir.core.BasicDao;
import cn.net.isir.entity.dto.FinanceStatistics;
import cn.net.isir.entity.dto.FinanceStatisticsDto;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.Map;

/**
 * @author liuxubo
 * @filename FinanceStatisticsDao.java
 * @package cn.net.isir.dao
 * @email lxb@isir.net.cn
 * @date 2018/12/04
 * @comment
 * @since 1.8
 */
@Repository
public class FinanceStatisticsDao extends BasicDao<FinanceStatistics> {

    /**
     * 根据订单查询统计信息
     * @param dto 查询实体类
     * @return 带分页的查询结果
     */
    public PageInfo<Map> statisticsByOrder(FinanceStatisticsDto dto) {
        return selectPageList(dto, "statisticsByOrder", dto.getPageNo(), dto.getPageSize());
    }

    /**
     * 根据品类查询统计信息
     * @param dto 查询实体类
     * @return 带分页的查询结果
     */
    public PageInfo<Map> statisticsByCategory(FinanceStatisticsDto dto) {
        return selectPageList(dto, "statisticsByCategory", dto.getPageNo(), dto.getPageSize());
    }

    /**
     * 根据菜品查询统计信息
     * @param dto 查询实体类
     * @return 带分页的查询结果
     */
    public PageInfo<Map> statisticsByGoods(FinanceStatisticsDto dto) {
        return selectPageList(dto, "statisticsByGoods", dto.getPageNo(), dto.getPageSize());
    }
}
